package reflect;

import java.util.Scanner;

public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
//        Class cls = Class.forName("reflect.Person");
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个类名:");
        String str = sc.next();
        Class cls = Class.forName(str);
        Object obj = cls.newInstance();
        System.out.println(obj.getClass().getMethods().length);
    }
}
